Conversation
BennyFranciscus
left a comment
There was a problem hiding this comment.
Bug on the db endpoint — the flags ended up as the second arg to $connection->send() instead of json_encode():
// Current (flags go to send(), not json_encode()):
return $connection->send(json_encode([...]), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
// Should be:
return $connection->send(json_encode([...], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));The largeJson() function on line 31 is correct — just the db endpoint at line 62 has the misplaced parenthesis.
Nice optimization btw — skipping unicode/slash escaping is free speed for json_encode. 👍
|
Fix looks good — both calls have the flags in the right place now. 👍 Want me to kick off a benchmark run to see how much the unescaped encoding helps on the json endpoints? |
|
/benchmark |
|
🚀 Benchmark run triggered for |
Benchmark ResultsFramework: Full log |
|
Nice — benchmark results look solid. Baseline and pipelined numbers are consistent with PR #243 (2.4-2.7M baseline, 3.7-3.8M pipelined), so no regression from the json encode change. JSON endpoint at ~700K req/s with the unescaped encoding — that's a good showing for PHP. 👍 |
|
btw there are 2 new tests you might want to add to workerman, static and async-db for http/1.1 test suite, they are now also included in the mixed |
|
Oh nice, didn't realize those got added to the mixed suite too. I'll look into adding static and async-db to the workerman config — static should be straightforward, async-db might need a bit more work depending on what the endpoint spec looks like. Will check the test definitions and put up a follow-up PR. |
|
Static was already enabled in the last PR. Need any change in the The Postgre Async-db will be added later. |
|
Ah right, my bad — I see the static file handler is already in If you want to add it in this PR, just drop And sounds good on async-db later — no rush on that one. |
|
ill trigger verification and benchmark in a sec |
|
/benchmark static |
|
🚀 Benchmark run triggered for |
Benchmark ResultsFramework: Full log |
|
1M+ req/s on static serving — workerman is holding up really well there. The ~14% drop from 4096 to 16384 connections is pretty typical for PHP userland event loops dealing with that many concurrent fds, nothing unusual. Looks like the static endpoint is good to go for the test suite. 👍 |
|
I didn't preloaded the files in the RAM
Tomorrow I'll try with the files preloaded in RAM. |
|
Or if you want @BennyFranciscus you can try it to add into RAM at startup of the test. I need to go, later I'll come back. |
|
Oh interesting — so those static numbers are with disk reads on every request? That's actually impressive then. 1M req/s without any in-memory caching is solid. Curious to see how much preloading bumps it. If the files fit comfortably in memory (which they should, the test templates are tiny), I'd expect a nice jump since you'd skip the syscall overhead entirely. Looking forward to the results! |
No description provided.